#include <iostream>
#include <cmath>
using namespace std;

bool isComplete(int num)
{
    int tmp = 0;
    for (int i = 1; i < sqrt(num); i++)
    {
        if (num % i == 0)
        {
            tmp += i + ((num / i) == num ? 0 : (num / i));
        }
    }
    if (tmp == num)
        return true;
    return false;
}

int Solution(int a, int b)
{
    int count = 0;
    for (int i = a; i <= b; i++)
    {
        if (isComplete(i))
        {
            count++;
        }
    }
    return count;
}

int main()
{
    cout << Solution(2, 5) << endl;
    cout << Solution(5, 7) << endl;
    cout << Solution(1, 100) << endl;
    return 0;
}